{template 'public/header'}

{template 'public/comhead'}

<link rel="stylesheet" type="text/css" href="../addons/yzzc_sun/template/public/ygcsslist.css">
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li  {if $type=='all'} class="active" {/if}><a href="{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&do=storelist&type=all&m=yzzc_sun">交还车列表</a></li>
</ul>
<br>
<div class="row ygrow">
    <div class="col-lg-12">
        <form action="" method="get" class="col-md-4">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="yzzc_sun" />
            <input type="hidden" name="do" value="shuttle" />
            <div class="input-group">
                <input type="text" name="keywords" class="form-control" placeholder="请输入名称">
                <span class="input-group-btn">
                    <input type="submit" class="btn btn-default" name="submit" value="查找"/>
                </span>
            </div>
            <input type="hidden" name="token" value="{$_W['token']}"/>
        </form>

        <div class="col-md-4">
            <input type="hidden" name="token" value="{$_W['token']}"/>
        </div>
    </div><!-- /.col-lg-6 -->
</div>

<div class="row ygrow">
    <div class='col-lg-12'>
        <a  href="/web/index.php?c=site&a=entry&op=add&do=shuttle&module_name=yzzc_sun&version_id=1"><button class="btn btn-sm store-blue">添加人员</button></a>
    </div>
</div>
<div class="main ">
    <div class="panel panel-default">
        <div class="panel-heading">
            门店列表
        </div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row" id="accordion">
                <table class="yg5_tabel col-md-12">
                    <tr class="yg5_tr1">
<!--                        <td  class="store_td1 col-md-1">编号</td>-->
                        <td  class="store_td1 ">姓名</td>
                        <td  class="store_td1 col-md-2">绑定会员</td>
                        <td  class="store_td1 col-md-1">余额</td>
                        <td  class="col-md-3">所属门店</td>
                        <td class="col-md-2">创建时间</td>
                        <td>操作</td>
                    </tr>
                    {loop $info $key $item}
                    <tbody>
                    <tr class="yg5_tr2" >
                        <td>{$item['name']}</td>
                        <td>{$item['user']['user_name']} / {$item['user']['user_tel']}</td>
                        <td>{$item['balance']}</td>
                        <td>
                            {loop $item['branch_info'] $index $i}
                            <span>{$i}</span>
                            {/loop}
                        </td>
                        <td>{$item['createtime']}</td>
                        <td>
                            <a href="/web/index.php?c=site&a=entry&op=add&do=shuttle&id={$item['id']}&op=edit&module_name=yzzc_sun&version_id=1" class="storespan btn btn-xs">
                                <span class="fa fa-pencil"></span>
                                <span class="bianji">编辑
                                    <span class="arrowdown"></span>
                                 </span>
                            </a>
                            <a href="javascript:;" class="storespan btn btn-xs" onclick="del({$item['id']})">
                                <span class="fa fa-trash-o"></span><span class="bianji">删除<span class="arrowdown"></span></span>
                            </a>
                        </td>
                    </tr>
                    </tbody>
                    {/loop}
                    {if empty($item)}
                    <tr class="yg5_tr2">
                        <td colspan="8">
                            暂无信息
                        </td>
                    </tr>
                    {/if}
                </table>
            </div>
        </div>

    </div>
    </form>
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-17").show();
        $("#yframe-17").addClass("wyactive");
    })
    function del(id) {
        var ret = confirm("您确定删除吗？")
        if (ret==true){
            $.ajax({
                type:"POST",
                url:"/web/index.php?c=site&a=entry&op=add&do=shuttle&op=delete&module_name=yzzc_sun&version_id=1",
                dataType:"JSON",
                data:{id:id},
                success:function(res){
                    if(res.type == 'success') {
                        location.reload();
                    }else{
                        alert('删除失败');
                    }
                }
            })
        }
    }
</script>